<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-05-05 22:02:56
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-01-10 22:42:59
-->
<template>
  <div  ref="bottom2_container" style="height:95%"></div>
</template>
<script>
import { Bar } from '@antv/g2plot';
export default {
  data(){
    return{
      dataArr:[ { year: '1951 年', value: 38 },
  { year: '1951 年', value: 1 },
  { year: '1952 年', value: 2 },
  { year: '1953 年', value: 3 },
  { year: '1954 年', value: 4 },]
    }
  },
  mounted() {
    this.initChart()
  },
  methods:{
    initChart(){const bar = new Bar(this.$refs.bottom2_container, {
  data:this.dataArr,
  xField: 'value',
  yField: 'year',
  seriesField: 'year',
  legend: {
    position: 'top-left',
  },
});

bar.render();
    }
  }
}
</script>